#!/bin/bash

# 软件配置文件软链接设置脚本

## 图片预览功能需要安装
# - ffmpegthumbnailer
# - ImageMagick
# - poppler
# - epub-thumbnailer
# - wkhtmltopdf
# - bat (optional - color highlight for text files)
# - chafa (optional - for image preview over SSH or inside Wayland session)
# - unzip (optional - for .zip and .jar files)
# - 7z (optional - for .7z files)
# - unrar (optional - for .rar files)
# - catdoc (optional - for .doc files)
# - docx2txt (optional - for .docx files)
# - odt2txt (optional - for .odt and *.ods files)
# - gnumeric (optional - for .xls and .xlsx files)
# - exiftool (optional - for music files)
# - iso-info (optional - for .iso files)
# - transmission (optional - for .torrent files)
# - mcomix (optional - for .cbz and .cbr files)

# brew install w3m
# brew install ffmpeg
brew install imagemagick
brew install ffmpegthumbnailer
brew install poppler
# brew install epub-thumbnailer # 好像mac下没有这个名字的软件包
brew install wkhtmltopdf
brew install bat
brew install chafa
# brew install timg   # 安装chafa 和 timg 选择一个就行 选完 需要到 ./preview 修改
brew install unzip
brew install 7z
brew install unrar
brew install catdoc
brew install docx2txt
brew install odt2txt
brew install gnumeric
brew install exiftool
brew install iso-info
brew install transmission
brew install mcomix


# 获取当前脚本目录位置
cd `dirname $0`
dir=`pwd`
echo ${dir}


# 备份 lf 配置文件
mv ~/.config/lf ~/.config/lf-`date +%y%m%d%H%M%S`
# 建立软链接命令拼接
cmdStr="ln -s  "${dir}"/  "${HOME}"/.config/lf"
echo "执行命令: ${cmdStr} 建立软链接"
${cmdStr}



# 将 lfrun 添加到 /usr/bin 或 /usr/local/bin 中
# 建立软链接命令拼接
cmdStr="sudo ln -s  "${dir}"/lfrun /usr/local/bin"
echo "执行命令: ${cmdStr} 建立软链接"
${cmdStr}

cmdStr="sudo ln -s  "${dir}"/cleaner /usr/local/bin"
echo "执行命令: ${cmdStr} 建立软链接"
${cmdStr}

cmdStr="sudo ln -s  "${dir}"/preview /usr/local/bin"
echo "执行命令: ${cmdStr} 建立软链接"
${cmdStr}


